function g = gradf1(x)
    g = zeros(4,1);
    g(1) = 2 * (x(1) + 10 * x(2)) + 40 * (x(1)-x(4))^3;
    g(2) = 20 * (x(1) + 10 * x(2)) + 4 * (x(2) - 2 * x(3))^3;
    g(3) = 10 * (x(3) - x(4)) - 8 * (x(2) - 2 * x(3))^3;
    g(4) = -10 * (x(3) - x(4)) - 40 * (x(1)-x(4))^3;
end